Skip to main content
Version: 2.x.x

WebsocketClientType


import { WebsocketClientType } from "@hyper-fetch/sockets"

Description

Defined in client/client.types.ts:8

Preview

type WebsocketClientType = {
connect: () => void;
connecting: boolean;
disconnect: () => void;
emit: (eventMessageId: string, emitter: EmitterInstance, ack?: (error: Error | null, response: any) => void) => void;
listen: (listener: ListenerInstance, callback: ListenerCallbackType) => RemoveListenerCallbackType;
listeners: Map<string, Set<ListenerCallbackType>>;
reconnect: () => void;
removeListener: (name: string, callback: (...args: any) => void) => void;
}

Structure

{
connect: () => void;
connecting: boolean;
disconnect: () => void;
emit: (eventMessageId: string, emitter: EmitterInstance, ack?: (error: Error | null, response: any) => void) => void;
listen: (listener: ListenerInstance, callback: ListenerCallbackType) => RemoveListenerCallbackType;
listeners: Map<string, Set<ListenerCallbackType>>;
reconnect: () => void;
removeListener: (name: string, callback: (...args: any) => void) => void;
}